package main

import "fmt"

//判断输入参数的类型
func typeJudge(item ...interface{}) {
	for index, x := range item {
		switch x.(type) {
		case bool:
			fmt.Printf("第%v个参数是bool类型,值为%v\n", index+1, x)
		case float64:
			fmt.Printf("第%v个参数是float64类型,值为%v\n", index+1, x)
		case float32:
			fmt.Printf("第%v个参数是float32类型,值为%v\n", index+1, x)
		case int, int8, int16, int32, int64:
			fmt.Printf("第%v个参数是int类型,值为%v\n", index+1, x)
		case string:
			fmt.Printf("第%v个参数是string类型,值为%v\n", index+1, x)
		case Stu:
			fmt.Printf("第%v个参数是Stu类型,值为%v\n", index+1, x)
		case *Stu:
			fmt.Printf("第%v个参数是*Stu类型,值为%v\n", index+1, x)
		default:
			fmt.Printf("第%v个参数 类型不确定,值为%v\n", index+1, x)
		}
	}
}

type Stu struct {
	Name string
}

func main() {
	stu1 := &Stu{"sam"}
	stu2 := Stu{"Rose"}
	typeJudge(123456, -15, "avc", 3.141595378, stu1, stu2)
}
